Fix doctest
failures for Python 3.10+ on AttributeError
messages
#56
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Quick one to fix some
doctest
failures for a full tests suite pass across supported Python 3.X versions. Notably there were a few failures due to the feature introduced in Python 3.10 which adds "Did you mean ..." suggestions to some error messages, such that Python 3.8 gives a shorterAttributeError
and in the affected cases:whereas e.g. Python 3.12 will show the extended message:
The ellipsis
...
marker indicates todoctest
any or no text at that location is acceptable and will ensure the tests pass for both message versions, and users can interpret it in the natural way as 'there may be further text after this', so it works for both machine and human.